<template>
	<view class="tencent">

		<!-- 公告类型弹框 -->
		<u-action-sheet title=" " :show="catalogShow">
			<view class="catalogDialogMain">
				<view class="catalogDialogMain_top">
					<view class="catalogDialogMain_header">
						<span>请选择公告类型</span>
						<image src="../../static/img/aclose.png" mode="" @click="catalogShow = false"></image>
					</view>
					<view class="catalogDialogMain_body">
						<view class="catalogDialogMain_body_left">
							<view class="catalogDialogMain_body_leftItem" v-for="(item,index) in catalogList"
								:key="index" :class="activeCatalogIndex == index?'activeCatalog':''"
								@click="chooseCatalogLeft(index)">
								{{item.label}}
							</view>
						</view>
						<view class="catalogDialogMain_body_right">
							<u-checkbox-group v-model="catalogResult" iconPlacement="right" placement="column"
								borderBottom shape="circle" labelColor="#333">
								<view class="" v-show="activeCatalogIndex == rightItem.index"
									v-for="rightItem in catalogChildList" :key="rightItem.value">
									<u-checkbox activeColor="#f43107" :label="rightItem.label"
										:name="rightItem.es_ids"></u-checkbox>
								</view>
							</u-checkbox-group>
						</view>
					</view>
				</view>
				<view class="catalogDialogMain_footer">
					<view class="catalogDialogMain_footer_reset" @click="resetCatalog">
						重置
					</view>
					<view class="catalogDialogMain_footer_confirm" @click="confirmCatalog">
						确定
					</view>
				</view>
			</view>
		</u-action-sheet>

		<!-- 招标公司类型弹框 -->

		<u-action-sheet title=" " :show="companyTypeShow">
			<view class="catalogDialogMain">
				<view class="catalogDialogMain_top">
					<view class="catalogDialogMain_header">
						<span>请选择招标公司类型</span>
						<image src="../../static/img/aclose.png" mode="" @click="companyTypeShow = false"></image>
					</view>
					<view class="catalogDialogMain_body">
						<view class="catalogDialogMain_body_companyType">
							<u-checkbox-group v-model="companyTypeResult" iconPlacement="right" placement="column"
								borderBottom shape="circle" labelColor="#333">
								<scroll-view scroll-y="true" style="height: 480rpx;">
									<view class="" style="padding: 0 30rpx 0 40rpx;"
										v-for="rightItem in companyTypeList" :key="rightItem.id">
										<u-checkbox activeColor="#f43107" :label="rightItem.label"
											:name="rightItem.id"></u-checkbox>
									</view>
								</scroll-view>
							</u-checkbox-group>
						</view>
					</view>
				</view>
				<view class="catalogDialogMain_footer">
					<view class="catalogDialogMain_footer_reset" @click="resetCompanyType">
						重置
					</view>
					<view class="catalogDialogMain_footer_confirm" @click="confirmCompanyType">
						确定
					</view>
				</view>
			</view>
		</u-action-sheet>

		<!-- 招标状态弹框 -->

		<u-action-sheet title=" " :show="tenderStatusShow">
			<view class="catalogDialogMain">
				<view class="catalogDialogMain_top">
					<view class="catalogDialogMain_header">
						<span>请选择招标状态</span>
						<image src="../../static/img/aclose.png" mode="" @click="tenderStatusShow = false"></image>
					</view>
					<view class="catalogDialogMain_body">
						<view class="catalogDialogMain_body_tenderStatus">
							<picker-view @change="tenderStatusChange" :value="tenderStatusResult"
								class="tenderStatusPicker" :indicator-style="indicatorStyle">
								<picker-view-column>
									<view class="item" v-for="(item,index) in tenderStatusList" :key="index">
										{{item.label}}
									</view>
								</picker-view-column>
							</picker-view>
						</view>
					</view>
				</view>
				<view class="catalogDialogMain_footer">
					<!-- <view class="catalogDialogMain_footer_reset" @click="resetCompanyType">
						重置
					</view> -->
					<view class="catalogDialogMain_footer_confirm" @click="confirmTenderStatus">
						确定
					</view>
				</view>
			</view>
		</u-action-sheet>

		<!-- 发布时间起止 -->
		<view class="timeBox">
			<u-datetime-picker :show="stimeShow" v-model="stime" mode="date" @cancel="stimeShow = false"
				@confirm="confirmStime"></u-datetime-picker>
			<u-datetime-picker :show="etimeShow" v-model="etime" mode="date" @cancel="etimeShow = false"
				@confirm="confirmEtime"></u-datetime-picker>
		</view>

		<!-- 联系方式弹框 -->
		<u-action-sheet title=" " :show="contactShow">
			<view class="catalogDialogMain">
				<view class="catalogDialogMain_top">
					<view class="catalogDialogMain_header">
						<span>请选择联系方式</span>
						<image src="../../static/img/aclose.png" mode="" @click="contactShow = false"></image>
					</view>
					<view class="catalogDialogMain_body">
						<view class="catalogDialogMain_body_tenderStatus">
							<picker-view @change="contactChange" :value="contactResult" class="tenderStatusPicker"
								:indicator-style="indicatorStyle">
								<picker-view-column>
									<view class="item" v-for="(item,index) in contactList" :key="index">
										{{item.label}}
									</view>
								</picker-view-column>
							</picker-view>
						</view>
					</view>
				</view>
				<view class="catalogDialogMain_footer">
					<!-- <view class="catalogDialogMain_footer_reset" @click="resetCompanyType">
						重置
					</view> -->
					<view class="catalogDialogMain_footer_confirm" @click="confirmContact">
						确定
					</view>
				</view>
			</view>
		</u-action-sheet>

		<!-- 金额区间弹框 -->
		<u-action-sheet title=" " :show="moneyShow">
			<view class="catalogDialogMain">
				<view class="catalogDialogMain_top">
					<view class="catalogDialogMain_header">
						<span>请选择金额区间</span>
						<image src="../../static/img/aclose.png" mode="" @click="moneyShow = false"></image>
					</view>
					<view class="catalogDialogMain_body">
						<view class="catalogDialogMain_body_tenderStatus">
							<picker-view @change="moneyChange" :value="moneyResult" class="tenderStatusPicker"
								:indicator-style="indicatorStyle">
								<picker-view-column>
									<view class="item" v-for="(item,index) in moneyList" :key="index">
										{{item.label}}
									</view>
								</picker-view-column>
							</picker-view>
						</view>
					</view>
				</view>
				<view class="catalogDialogMain_footer">
					<view class="catalogDialogMain_footer_confirm" @click="confirmMoney">
						确定
					</view>
				</view>
			</view>
		</u-action-sheet>

		<!-- 附件弹框 -->
		<u-action-sheet title=" " :show="attachShow">
			<view class="catalogDialogMain">
				<view class="catalogDialogMain_top">
					<view class="catalogDialogMain_header">
						<span>请选择附件</span>
						<image src="../../static/img/aclose.png" mode="" @click="attachShow = false"></image>
					</view>
					<view class="catalogDialogMain_body">
						<view class="catalogDialogMain_body_tenderStatus">
							<picker-view @change="attachChange" :value="attachResult" class="tenderStatusPicker"
								:indicator-style="indicatorStyle">
								<picker-view-column>
									<view class="item" v-for="(item,index) in attachList" :key="index">
										{{item.label}}
									</view>
								</picker-view-column>
							</picker-view>
						</view>
					</view>
				</view>
				<view class="catalogDialogMain_footer">
					<view class="catalogDialogMain_footer_confirm" @click="confirmAttach">
						确定
					</view>
				</view>
			</view>
		</u-action-sheet>

		<!-- 匹配模式弹框 -->
		<u-action-sheet title=" " :show="vagueShow">
			<view class="catalogDialogMain">
				<view class="catalogDialogMain_top">
					<view class="catalogDialogMain_header">
						<span>请选择匹配模式</span>
						<image src="../../static/img/aclose.png" mode="" @click="vagueShow = false"></image>
					</view>
					<view class="catalogDialogMain_body">
						<view class="catalogDialogMain_body_tenderStatus">
							<picker-view @change="vagueChange" :value="vagueResult" class="tenderStatusPicker"
								:indicator-style="indicatorStyle">
								<picker-view-column>
									<view class="item" v-for="(item,index) in vagueList" :key="index">
										{{item.label}}
									</view>
								</picker-view-column>
							</picker-view>
						</view>
					</view>
				</view>
				<view class="catalogDialogMain_footer">
					<view class="catalogDialogMain_footer_confirm" @click="confirmVague">
						确定
					</view>
				</view>
			</view>
		</u-action-sheet>

		<view class="tencent_header_top">
			<u-tabs :list="tabList" @click="tabclick" :inactiveStyle="inactiveStyle" :activeStyle="activeStyle"
				lineColor="#fff" :current="tabCurrent"></u-tabs>
		</view>
		<view class="tencent_header_bottom">
			<view class="tencent_header_bottom_search">
				<image src="../../static/img/z6929@2x.png" mode=""></image>
				<span>{{keyWord}}</span>
			</view>
			<view class="tencent_header_bottom_hot">
				<span>热门:</span>
				<span v-for="(item,index) in hot_search" :key="index">{{item}}</span>
			</view>
		</view>
		<view class="tencent_main">
			<swiper class="swiper" :duration="500">
				<swiper-item>
					<view class="swiper-item">
						<g-condition :options="options" :form="form" @confirm="confirm" @handleMore="handleMore">
							<template slot="more">
								<view class="moreBox">
									<scroll-view scroll-y="true" style="height: 800rpx;padding-bottom: 100rpx;">
										<view class="moreBoxItem" @click="openCatalog">
											<view class="moreBoxItem_title">
												公告类型
											</view>
											<view class="moreBoxItem_value">
												<span>{{textForm.catalogText}}</span>
												<image src="../../static/img/alright.png" mode=""></image>
											</view>
										</view>
										<view class="moreBoxItem" @click="openCompanyType">
											<view class="moreBoxItem_title">
												招标公司类型
											</view>
											<view class="moreBoxItem_value">
												<span>{{textForm.companyTypeText}}</span>
												<image src="../../static/img/alright.png" mode=""></image>
											</view>
										</view>
										<view class="moreBoxItem" @click="openTenderStatus">
											<view class="moreBoxItem_title">
												招标状态
											</view>
											<view class="moreBoxItem_value">
												<span>{{textForm.tenderStatusText}}</span>
												<image src="../../static/img/alright.png" mode=""></image>
											</view>
										</view>
										<view class="moreBoxItem_time">
											<view class="moreBoxItem_time_top">
												<view class="moreBoxItem_title">
													发布时间
												</view>
												<view class="moreBoxItem_value">
													{{textForm.timeText}}
												</view>
											</view>
											<view class="moreBoxItem_time_bottom">
												<view class="moreBoxItem_time_bottomItem"
													@click="getTimeRangeBefore(0,'今天')"
													:class="activeTimeIndex == 0?'activeTime':''">
													今天
												</view>
												<view class="moreBoxItem_time_bottomItem"
													@click="getTimeRangeBefore(1,'昨天')"
													:class="activeTimeIndex == 1?'activeTime':''">
													昨天
												</view>
												<view class="moreBoxItem_time_bottomItem"
													@click="getTimeRangeBefore(7,'近一周')"
													:class="activeTimeIndex == 7?'activeTime':''">
													近一周
												</view>
												<view class="moreBoxItem_time_bottomItem"
													@click="getTimeRangeBefore(30,'近一月')"
													:class="activeTimeIndex == 30?'activeTime':''">
													近一月
												</view>
												<view class="moreBoxItem_time_bottomItem"
													@click="getTimeRangeBefore(90,'近三月')"
													:class="activeTimeIndex == 90?'activeTime':''">
													近三月
												</view>
												<view style="margin-right: 0;" class="moreBoxItem_time_bottomItem"
													@click="handleTimeCustom"
													:class="activeTimeIndex == -2?'activeTime':''">
													自定义
												</view>
											</view>
											<view class="timePickBox" v-if="timePickShow">
												<view class="timePickBoxItem" @click="stimeShow = true">
													{{stimeText}}
												</view>
												<span>~</span>
												<view class="timePickBoxItem" @click="etimeShow = true">
													{{etimeText}}
												</view>
											</view>
										</view>
										<view class="moreBoxItem" @click="openContact">
											<view class="moreBoxItem_title">
												联系方式
											</view>
											<view class="moreBoxItem_value">
												<span>{{textForm.contactText}}</span>
												<image src="../../static/img/alright.png" mode=""></image>
											</view>
										</view>
										<view class="moreBoxItem" @click="openMoney">
											<view class="moreBoxItem_title">
												金额区间
											</view>
											<view class="moreBoxItem_value">
												<span>{{textForm.moneyText}}</span>
												<image src="../../static/img/alright.png" mode=""></image>
											</view>
										</view>
										<view class="moreBoxItem" @click="openAttach">
											<view class="moreBoxItem_title">
												附件
											</view>
											<view class="moreBoxItem_value">
												<span>{{textForm.attachText}}</span>
												<image src="../../static/img/alright.png" mode=""></image>
											</view>
										</view>
										<view class="moreBoxItem" @click="openVague">
											<view class="moreBoxItem_title">
												匹配模式
											</view>
											<view class="moreBoxItem_value">
												<span>{{textForm.vagueText}}</span>
												<image src="../../static/img/alright.png" mode=""></image>
											</view>
										</view>
										<view class="moreBoxItem_keyword">
											<view class="moreBoxItem_title">
												同时包含关键词
											</view>
											<view class="moreBoxItem_keywordBox">
												<view class="moreBoxItem_keywordBoxItem"
													v-for="(item,index) in keywordArr" :key="index">
													<span>{{item}}</span>
													<image src="../../static/img/tagclose.png" mode=""
														@click="delTsItem(index)"></image>
												</view>
											</view>
											<view class="moreBoxItem_keywordInput">
												<view class="" style="width: 550rpx;">
													<u--input placeholder="请输入关键词" border="surround" v-model="tValue"
														:customStyle="{height:'60rpx'}"
														:placeholderStyle="{fontSize:'28rpx',color:'#A9B1BE'}"></u--input>
												</view>
												<view class="moreBoxItem_keywordInput_addbtn" @click="addTs">
													添加
												</view>
											</view>
										</view>
										<view class="moreBoxItem_keyword">
											<view class="moreBoxItem_title">
												排除词
											</view>
											<view class="moreBoxItem_keywordBox">
												<view class="moreBoxItem_keywordBoxItem"
													v-for="(item,index) in psKeywordArr" :key="index">
													<span>{{item}}</span>
													<image src="../../static/img/tagclose.png" mode=""
														@click="delPsItem(index)"></image>
												</view>
											</view>
											<view class="moreBoxItem_keywordInput">
												<view class="" style="width: 550rpx;">
													<u--input placeholder="请输入关键词" border="surround" v-model="psValue"
														:customStyle="{height:'60rpx'}"
														:placeholderStyle="{fontSize:'28rpx',color:'#A9B1BE'}"></u--input>
												</view>
												<view class="moreBoxItem_keywordInput_addbtn" @click="addPs">
													添加
												</view>
											</view>
										</view>
									</scroll-view>
									<view class="moreBox_footer">
										<view class="moreBox_footer_cancel" @click="overReset">
											重置
										</view>
										<view class="moreBox_footer_confirm" @click="overConfirm">
											确定
										</view>
									</view>
								</view>
							</template>
						</g-condition>
						123
					</view>
				</swiper-item>
				<swiper-item>
					<view class="swiper-item">B</view>
				</swiper-item>
				<swiper-item>
					<view class="swiper-item">C</view>
				</swiper-item>
			</swiper>
		</view>
	</view>
</template>

<script>
	import gCondition from '@/components/g-condition/g-condition.vue'
	import {
		getConfig,
		getIndustry,
		getCatalogInfo,
		getCompanyTypeInfo,
		getSearch
	} from '@/api/index.js'
	import {
		timeFormat_
	} from '@/utils/tools.js'
	export default {
		components: {
			gCondition
		},
		data() {
			return {
				searchList:[],
				count:0,
				indicatorStyle: `height: 50px;`,
				inactiveStyle: {
					color: '#fff',
					fontSize: '32rpx',
					fontWeight: 400
				},
				activeStyle: {
					color: '#fff',
					fontSize: '36rpx',
					fontWeight: 600
				},
				tabList: [{
						name: '标讯'
					},
					{
						name: '商机'
					},
					{
						name: '公司'
					}
				],
				tabCurrent: 0,
				keyWord: '',
				hot_search: [],
				options: [{
						isChange: false,
						title: '搜索范围',
						type: 'check',
						value: 'range',
						data: [{
								id: "product",
								label: "产品",
							},
							{
								id: "title",
								label: "标题",
							},
							{
								id: "brand",
								label: "品牌",
							},
							{
								id: "tenderCompany",
								label: "招标公司",
							},
							{
								id: "bidCompany",
								label: "中标公司",
							},
							{
								id: "agentCompany",
								label: "代理公司",
							},
							{
								id: "full",
								label: "全文",
							},
						]
					},
					{
						isChange: false,
						title: '采购类别',
						type: 'check',
						value: 'industry',
						data: []
					},
					{
						isChange: false,
						title: '项目地区',
						type: 'area',
						value: 'area'
					},
					{
						title: '更多选项',
						type: 'more',
					}
				],
				catalogList: [],
				companyTypeList: [],
				tenderStatusList: [{
						id: '',
						label: '全部',
					},
					{
						id: 1,
						label: '标书获取中',
					},
					{
						id: 2,
						label: '投标中',
					},
					{
						id: 3,
						label: '投标已截止',
					},
					{
						id: 4,
						label: '其他',
					}
				],
				contactList: [{
						id: '',
						label: '全部'
					},
					{
						id: 1,
						label: '有招标联系方式'
					},
					{
						id: 2,
						label: '有中标联系方式'
					},
					{
						id: 3,
						label: '有代理联系方式'
					},
					{
						id: 4,
						label: '有联系方式'
					},
				],
				moneyList: [{
						id: "",
						label: "全部",
					},
					{
						id: 1,
						label: "0~10万",
					},
					{
						id: 2,
						label: "10~20万",
					},
					{
						id: 3,
						label: "20~50万",
					},
					{
						id: 4,
						label: "50~100万",
					},
					{
						id: 5,
						label: "100~200万",
					},
					{
						id: 6,
						label: "200~500万",
					},
					{
						id: 7,
						label: "500~1000万",
					},
				],
				attachList: [{
						id: '',
						label: '全部'
					},
					{
						id: 'Y',
						label: '有附件'
					}
				],
				vagueList: [{
						id: 'N',
						label: '精准匹配'
					},
					{
						id: 'Y',
						label: '模糊匹配'
					}
				],
				form: {
					range: [],
					industry: [],
					area: [],
				},
				textForm: {
					catalogText: '',
					companyTypeText: '',
					tenderStatusText: '',
					timeText: '',
					contactText: '',
					moneyText: '',
					attachText: '',
					vagueText: ''
				},
				//公告类型
				catalogShow: false,
				activeCatalogIndex: 0,
				catalogChildList: [],
				catalogResult: [],
				realCatalogResult: [],

				// 招标公司类型
				companyTypeShow: false,
				companyTypeResult: [],
				realCompanyTypeResult: [],

				//招标状态
				tenderStatusShow: false,
				tenderStatusResult: [],
				realTenderStatusResult: '',

				//发布时间
				activeTimeIndex: -1,
				stime: Number(new Date()),
				etime: Number(new Date()),
				timePickShow: false,
				stimeShow: false,
				etimeShow: false,
				stimeText: '开始时间',
				etimeText: '结束时间',

				//联系方式
				contactShow: false,
				contactResult: [],
				realContactResult: '',

				//金额区间
				moneyShow: false,
				moneyResult: [],
				realMoneyResult: '',
				minAmount: '',
				maxAmount: '',

				//附件
				attachShow: false,
				attachResult: [],
				realAttachResult: '',

				//匹配模式
				vagueShow: false,
				vagueResult: [],
				realVagueResult: '',

				//同时包含关键词
				keywordArr: [],
				tValue: '',

				//排除词
				psKeywordArr: [],
				psValue: '',
				
				
				//页码
				page:1,
				
				//备份数据
				copyData:{},
				copyTextForm:{}
			}
		},
		methods: {
			handleMore(){
				this.copyData = JSON.parse(JSON.stringify({
					keywordArr:this.keywordArr,
					psKeywordArr:this.psKeywordArr,
					realVagueResult:this.realVagueResult,
					realCatalogResult:this.realCatalogResult,
					realCompanyTypeResult:this.realCompanyTypeResult,
					realTenderStatusResult:this.realTenderStatusResult,
					minAmount:this.minAmount,
					maxAmount:this.maxAmount,
					stime:this.stime,
					etime:this.etime,
					stimeText:this.stimeText,
					etimeText:this.etimeText,
					activeTimeIndex:this.activeTimeIndex,
					realContactResult:this.realContactResult,
					realMoneyResult:this.realMoneyResult,
					realAttachResult:this.realAttachResult,
					tValue:this.tValue,
					psValue:this.psValue
				}))
				this.copyTextForm = JSON.parse(JSON.stringify(this.textForm))
			},
			async getSearchList(){
				let keyword = [{"text":this.keyWord,"field":this.form.range.join(',')},{"text":this.keywordArr.join(' '),"field":''}]
				let notKeyword = [{"text":this.psKeywordArr.join(' '),"field":''}]
				let data = {
					keyword:JSON.stringify(keyword),
					notKeyword:JSON.stringify(notKeyword),
					keywod_vague:this.realVagueResult,
					industry:this.form.industry.join(','),
					provinceIds:this.form.area.length>0?this.form.area[0]:'',
					cityId:this.form.area.length>0?this.form.area[1]:'',
					catalogIds:this.realCatalogResult.join(','),
					company_type_id:this.realCompanyTypeResult.join(','),
					tender_status:this.realTenderStatusResult,
					minAmount:this.minAmount,
					maxAmount:this.maxAmount,
					attach:this.realAttachResult,
					timeType:'release_time',
					stime:Math.floor(this.stime/1000),
					etime:Math.floor(this.etime/1000),
					contact:this.realContactResult,
					pageSize:10,
					page:this.page
				}
				const res = await getSearch(data)
				this.searchList = res.data.data
				this.count = res.data.count*1
			},
			async overConfirm(){
				
			},
			overReset() { //外重置
				this.catalogResult = []
				this.realCatalogResult = []
				this.companyTypeResult = []
				this.realCompanyTypeResult = []
				this.tenderStatusResult = []
				this.realTenderStatusResult = ''
				this.stime = Number(new Date())
				this.etime = Number(new Date())
				this.stimeText = '开始时间'
				this.etimeText = '结束时间'
				this.activeTimeIndex = -1
				this.contactResult = []
				this.realContactResult = []
				this.moneyResult = []
				this.realMoneyResult = ''
				this.minAmount = ''
				this.maxAmount = ''
				this.attachResult = []
				this.realAttachResult = ''
				this.vagueResult = []
				this.realVagueResult = ''
				this.keywordArr = []
				this.tValue = ''
				this.psKeywordArr = []
				this.psValue = ''

				for (let key in this.textForm) {
					this.textForm[key] = ''
				}
			},
			delTsItem(i) {
				this.keywordArr.splice(i, 1)
			},
			delPsItem(i) {
				this.psKeywordArr.splice(i, 1)
			},
			addPs() {
				if (this.psValue == '') {
					return uni.showToast({
						title: '请填写关键词',
						icon: 'none'
					})
				}
				let index = this.psKeywordArr.findIndex(item => item == this.psValue)
				if (index == -1) {
					this.psKeywordArr.push(this.psValue)
					this.psValue = ''
				} else {
					return uni.showToast({
						title: '已添加相同关键词',
						icon: 'none'
					})
				}
			},
			addTs() {
				if (this.tValue == '') {
					return uni.showToast({
						title: '请填写关键词',
						icon: 'none'
					})
				}
				let index = this.keywordArr.findIndex(item => item == this.tValue)
				if (index == -1) {
					this.keywordArr.push(this.tValue)
					this.tValue = ''
				} else {
					return uni.showToast({
						title: '已添加相同关键词',
						icon: 'none'
					})
				}
			},
			confirmCatalog() {
				this.realCatalogResult = JSON.parse(JSON.stringify(this.catalogResult))
				this.textForm.catalogText = this.realCatalogResult.length > 0 ? `已选：${this.realCatalogResult.length}个` : ''
				this.catalogShow = false
			},
			confirmCompanyType() {
				this.realCompanyTypeResult = JSON.parse(JSON.stringify(this.companyTypeResult))
				this.textForm.companyTypeText = this.realCompanyTypeResult.length > 0 ?
					`已选：${this.realCompanyTypeResult.length}个` : ''
				this.companyTypeShow = false
			},
			confirmTenderStatus() {
				this.realTenderStatusResult = this.tenderStatusList[this.tenderStatusResult[0]].id
				let str = this.tenderStatusList[this.tenderStatusResult[0]].label
				this.textForm.tenderStatusText = str == '全部' ? '' : str
				this.tenderStatusShow = false
			},
			confirmContact() {
				this.realContactResult = this.contactList[this.contactResult[0]].id
				let str = this.contactList[this.contactResult[0]].label
				this.textForm.contactText = str == '全部' ? '' : str
				this.contactShow = false
			},
			confirmAttach() {
				this.realAttachResult = this.attachList[this.attachResult[0]].id
				let str = this.attachList[this.attachResult[0]].label
				this.textForm.attachText = str == '全部' ? '' : str
				this.attachShow = false
			},
			confirmVague() {
				this.realVagueResult = this.vagueList[this.vagueResult[0]].id
				let str = this.vagueList[this.vagueResult[0]].label
				this.textForm.vagueText = str == '全部' ? '' : str
				this.vagueShow = false
			},
			confirmMoney() {
				this.realMoneyResult = this.moneyList[this.moneyResult[0]].id
				let str = this.moneyList[this.moneyResult[0]].label
				this.textForm.moneyText = str == '全部' ? '' : str
				this.moneyShow = false
				switch (this.realMoneyResult) {
					case 0:
						this.minAmount = ''
						this.maxAmount = ''
						break;
					case 1:
						this.minAmount = 0
						this.maxAmount = 10
						break;
					case 2:
						this.minAmount = 10
						this.maxAmount = 20
						break;
					case 3:
						this.minAmount = 20
						this.maxAmount = 50
						break;
					case 4:
						this.minAmount = 50
						this.maxAmount = 100
						break;
					case 5:
						this.minAmount = 100
						this.maxAmount = 200
						break;
					case 6:
						this.minAmount = 200
						this.maxAmount = 500
						break;
					case 7:
						this.minAmount = 500
						this.maxAmount = 1000
						break;
				}
			},
			confirmStime(e) {
				this.stimeShow = false
				if (e.value > this.etime) {
					return uni.showToast({
						title: '开始时间不能大于结束时间',
						icon: 'none'
					})
				}
				this.stime = e.value
				this.stimeText = timeFormat_(Math.floor(this.stime / 1000))
			},
			confirmEtime(e) {
				this.etimeShow = false
				if (e.value < this.stime) {
					return uni.showToast({
						title: '开始时间不能大于结束时间',
						icon: 'none'
					})
				}
				this.etime = e.value
				this.etimeText = timeFormat_(Math.floor(this.etime / 1000))
			},
			resetCatalog() {
				this.catalogResult = []
			},
			resetCompanyType() {
				this.companyTypeResult = []
			},
			chooseCatalogLeft(i) {
				this.activeCatalogIndex = i
			},
			async getCatalog() {
				const res = await getCatalogInfo()
				this.catalogList = res.data
				let arr = []
				res.data.forEach((item, index) => {
					item.children.forEach(c => {
						c.index = index
						arr.push(c)
					})
				})
				this.catalogChildList = arr
			},
			async getCompanyType() {
				const res = await getCompanyTypeInfo()
				this.companyTypeList = res.data
			},
			openCatalog() {
				this.catalogShow = true
				this.catalogResult = JSON.parse(JSON.stringify(this.realCatalogResult))
			},
			openCompanyType() {
				this.companyTypeShow = true
				this.companyTypeResult = JSON.parse(JSON.stringify(this.realCompanyTypeResult))
			},
			openTenderStatus() {
				this.tenderStatusShow = true
				this.tenderStatusResult = [this.tenderStatusList.findIndex(item => item.id == this.realTenderStatusResult)]
			},
			openContact() {
				this.contactShow = true
				this.contactResult = [this.contactList.findIndex(item => item.id == this.realContactResult)]
			},
			openMoney() {
				this.moneyShow = true
				this.moneyResult = [this.moneyList.findIndex(item => item.id == this.realMoneyResult)]
			},
			openAttach() {
				this.attachShow = true
				this.attachResult = [this.attachList.findIndex(item => item.id == this.realAttachResult)]
			},
			openVague() {
				this.vagueShow = true
				this.vagueResult = [this.vagueList.findIndex(item => item.id == this.realVagueResult)]
			},
			tenderStatusChange(e) {
				this.tenderStatusResult = e.detail.value
			},
			contactChange(e) {
				this.contactResult = e.detail.value
			},
			moneyChange(e) {
				this.moneyResult = e.detail.value
			},
			attachChange(e) {
				this.attachResult = e.detail.value
			},
			vagueChange(e) {
				this.vagueResult = e.detail.value
			},
			tabclick(e) {

			},
			async getCf() {
				const res = await getConfig()
				this.hot_search = res.data.hot_search.split(',')
			},
			async getIn() {
				const res = await getIndustry()
				// console.log(res);
				this.options[1].data = res.data.map(item => {
					return {
						id: item.es_tag,
						label: item.name
					}
				})
			},
			confirm(val) {
				this.form[val.key] = val.value
				this.options[val.index].isChange = val.isChange
			},
			getTimeRangeBefore(daysAgo, str) {
				this.timePickShow = false
				this.stimeText = '开始时间'
				this.etimeText = '结束时间'
				this.textForm.timeText = str
				this.activeTimeIndex = daysAgo
				const today = new Date();
				today.setHours(0, 0, 0, 0);

				if (daysAgo === 0) {
					this.stime = today.getTime()
					this.etime = Date.now()
					return
				}

				const endTimestamp = today.getTime();

				const start = new Date(today);
				start.setDate(start.getDate() - daysAgo);
				const startTimestamp = start.getTime();

				this.stime = startTimestamp
				this.etime = endTimestamp
			},
			handleTimeCustom() {
				this.activeTimeIndex = -2
				this.textForm.timeText = ''
				this.timePickShow = true
			}
		},
		onLoad() {
			this.getCf()
			this.getIn()
			this.getCatalog()
			this.getCompanyType()
		},
	}
</script>

<style scoped lang="scss">
	.tencent {
		// min-height: 100vh;
		height: 100vh;
		display: flex;
		flex-direction: column;

		::v-deep .u-popup__content {
			background-color: transparent;
		}

		::v-deep .u-action-sheet__header__icon-wrap {
			display: none;
		}

		.catalogDialogMain {
			padding: 0 30rpx;

			.catalogDialogMain_footer {

				.catalogDialogMain_footer_reset,
				.catalogDialogMain_footer_confirm {
					width: 690rpx;
					height: 88rpx;
					background: #FFFFFF;
					border-radius: 20rpx;
					font-family: PingFang SC;
					font-weight: 400;
					font-size: 32rpx;

					line-height: 88rpx;
					text-align: center;
					margin-top: 20rpx;
				}

				.catalogDialogMain_footer_reset {
					color: #A9B1BE;
				}

				.catalogDialogMain_footer_confirm {
					color: #304156;
				}
			}

			.catalogDialogMain_top {
				background: #FFFFFF;
				border-radius: 20rpx;
				overflow: hidden;


				.catalogDialogMain_body {
					display: flex;

					.catalogDialogMain_body_left {
						width: 240rpx;
						background-color: #f5f5f5;
						margin-right: 40rpx;

						.catalogDialogMain_body_leftItem {
							height: 88rpx;
							font-family: PingFang SC;
							font-weight: 400;
							font-size: 30rpx;
							color: #333333;
							line-height: 88rpx;
							padding-left: 40rpx;
							text-align: left;
						}

						.activeCatalog {
							background-color: #fff;
							color: #F43107;
						}
					}

					.catalogDialogMain_body_right {
						width: 0;
						flex: 1;

						::v-deep .u-checkbox-label--right {
							height: 88rpx;
							padding: 0 30rpx 0 0;
							font-family: PingFang SC;
							font-weight: 500;
							font-size: 30rpx;
							padding-bottom: 0 !important;
						}

						::v-deep .u-border-bottom {
							border-color: #DDDDDD !important;
						}
					}

					.catalogDialogMain_body_tenderStatus {
						width: 100%;

						.tenderStatusPicker {
							width: 100%;
							height: 500rpx;

							::v-deep .item {
								height: 100rpx !important;
								line-height: 100rpx;
							}
						}
					}

					.catalogDialogMain_body_companyType {
						width: 100%;

						::v-deep .u-checkbox-label--right {
							height: 88rpx;
							padding: 0;
							font-family: PingFang SC;
							font-weight: 500;
							font-size: 30rpx;
							padding-bottom: 0 !important;
						}

						::v-deep .u-border-bottom {
							border-color: #DDDDDD !important;
						}
					}
				}

				.catalogDialogMain_header {
					height: 100rpx;
					padding: 0 30rpx 0 40rpx;
					display: flex;
					align-items: center;
					justify-content: space-between;

					image {
						width: 40rpx;
						height: 40rpx;
					}

					span {
						font-family: PingFang SC;
						font-weight: 500;
						font-size: 32rpx;
						color: #333333;
					}
				}
			}
		}

		.timeBox {
			::v-deep .u-transition {
				background-color: #fff;
			}
		}

		.tencent_header_top {
			height: 176rpx;
			background-image: url('https://www.6dbx.com/static/ydImg/tencent1Bg.png');
			background-size: cover;
			display: flex;
			align-items: flex-end;
			justify-content: center;
		}

		.tencent_header_bottom {
			height: 202rpx;
			background-image: url('https://www.6dbx.com/static/ydImg/tencentBg.png');
			background-size: cover;
			padding: 32rpx 30rpx;

			.tencent_header_bottom_search {
				width: 690rpx;
				height: 72rpx;
				background: #FFFFFF;
				border-radius: 124rpx;
				padding-left: 30rpx;
				display: flex;
				align-items: center;

				image {
					width: 32rpx;
					height: 32rpx;
				}

				span {
					margin-left: 20rpx;
					font-family: PingFang SC;
					font-weight: 400;
					font-size: 32rpx;
					color: #304156;
				}
			}

			.tencent_header_bottom_hot {
				margin-top: 30rpx;
				font-family: PingFang SC;
				font-weight: 400;
				font-size: 24rpx;
				color: #FFFFFF;
				line-height: 34rpx;
				padding: 0 36rpx;

				span {
					margin-right: 20rpx;
				}
			}
		}

		.tencent_main {
			height: 0;
			flex: 1;

			.swiper {
				width: 750rpx;
				height: 100%;

				.swiper-item {
					::v-deep .u-checkbox-label--right {
						height: 100rpx;
						padding: 0 30rpx !important;
					}

					.moreBox {
						padding: 0 30rpx;
						position: relative;

						.moreBoxItem_keyword {
							padding: 24rpx 0;
							border-bottom: 1rpx solid #DDDDDD;

							.moreBoxItem_title {
								font-family: PingFang SC;
								font-weight: 500;
								font-size: 28rpx;
								color: #333333;
								line-height: 40rpx;
							}

							.moreBoxItem_keywordInput {
								display: flex;
								justify-content: space-between;
								align-items: center;

								.moreBoxItem_keywordInput_addbtn {
									width: 120rpx;
									height: 60rpx;
									background: #F43107;
									border-radius: 8rpx;
									font-family: PingFang SC;
									font-weight: 400;
									font-size: 28rpx;
									color: #FFFFFF;
									line-height: 60rpx;
									text-align: center;
								}
							}

							.moreBoxItem_keywordBox {
								display: flex;
								align-items: center;
								flex-wrap: wrap;
								margin-top: 20rpx;

								.moreBoxItem_keywordBoxItem {
									display: flex;
									align-items: center;
									padding: 8rpx 16rpx;
									background: #F6F6F6;
									border-radius: 8rpx;
									margin-right: 20rpx;
									margin-bottom: 20rpx;

									span {
										font-family: PingFang SC;
										font-weight: 400;
										font-size: 24rpx;
										color: #304156;
										line-height: 36rpx;
									}

									image {
										width: 20rpx;
										height: 20rpx;
										margin-left: 16rpx;
									}
								}
							}
						}

						.moreBoxItem {
							padding: 24rpx 0;
							border-bottom: 1rpx solid #DDDDDD;
							display: flex;
							align-items: center;
							justify-content: space-between;

							.moreBoxItem_title {
								font-family: PingFang SC;
								font-weight: 500;
								font-size: 28rpx;
								color: #333333;
								line-height: 40rpx;
							}

							.moreBoxItem_value {
								display: flex;
								align-items: center;

								span {
									font-family: PingFang SC;
									font-weight: 400;
									font-size: 28rpx;
									color: #304156;
									line-height: 40rpx;
								}

								image {
									width: 16rpx;
									height: 28rpx;
									margin-left: 12rpx;
								}
							}
						}

						.moreBoxItem_time {
							padding: 24rpx 0;
							border-bottom: 1rpx solid #DDDDDD;

							.moreBoxItem_time_top {
								display: flex;
								align-items: center;
								justify-content: space-between;

								.moreBoxItem_title {
									font-family: PingFang SC;
									font-weight: 500;
									font-size: 28rpx;
									color: #333333;
									line-height: 40rpx;
								}

								.moreBoxItem_value {
									font-family: PingFang SC;
									font-weight: 400;
									font-size: 28rpx;
									color: #304156;
									line-height: 40rpx;
								}
							}

							.moreBoxItem_time_bottom {
								display: flex;
								align-items: center;
								margin-top: 20rpx;

								.moreBoxItem_time_bottomItem {
									background: #F6F6F6;
									border-radius: 8rpx;
									padding: 8rpx 16rpx;
									font-family: PingFang SC;
									font-weight: 400;
									font-size: 24rpx;
									color: #304156;
									line-height: 36rpx;
									margin-right: 20rpx;
								}

								.activeTime {
									background: #FEF8F7;
									color: #F43107;
								}
							}

							.timePickBox {
								display: flex;
								align-items: center;
								justify-content: space-between;
								margin-top: 20rpx;

								.timePickBoxItem {
									width: 320rpx;
									height: 60rpx;
									background-color: #d5d4de;
									font-size: 24rpx;
									color: #333;
									font-family: PingFang SC;
									text-align: center;
									line-height: 60rpx;
									border-radius: 12rpx;
								}
							}
						}

						.moreBox_footer {
							width: 750rpx;
							position: absolute;
							left: 0;
							bottom: 0;
							display: flex;
							align-items: center;
							justify-content: space-between;
							height: 100rpx;
							padding: 0 84rpx;

							.moreBox_footer_cancel,
							.moreBox_footer_confirm {
								width: 240rpx;
								height: 68rpx;
								border-radius: 8rpx;
								font-family: PingFang SC;
								font-weight: 400;
								font-size: 32rpx;
								text-align: center;
								line-height: 68rpx;
							}

							.moreBox_footer_cancel {
								background: #F6F6F6;
								color: #A9B1BE;
							}

							.moreBox_footer_confirm {
								background: #F43107;
								color: #fff;
							}
						}
					}
				}
			}
		}
	}
</style>